define(['app'], function(app) {
	'use strict';

	var controller = function controller($scope, Train, $stateParams, $sce, GoPage, Auth, GoDialog) {
		//页面离开，分享关闭
		$scope.$on('$ionicView.afterEnter', function() {
			//动态设置高度
			GoPage.init_top($scope);
			$scope.loadIframe();
		}, false);
		$scope.loadIframe = function() {
			var info = Auth.get_loginInfo();
			var url = HTTP_URL_TRAIN + "?session=" + info.user_id;//user_id就是session
			$scope.myURL = $sce.trustAsResourceUrl(url);
		};
	}

	controller.$inject = ['$scope', 'Train', '$stateParams', '$sce', 'GoPage', 'Auth', 'GoDialog'];

	return app.registerController("trainctrl", controller);
});